package com.briup.framework.utils.execption;

import com.briup.framework.utils.web.ResponseCode;

/**
 * @Author guomiao
 * @Date 2022/3/3 15:18
 */

public class BriupFrameworkException extends RuntimeException{
    private ResponseCode code;

    public ResponseCode getCode() {
        return code;
    }

    public void setCode(ResponseCode code) {
        this.code = code;
    }

    public BriupFrameworkException() {
        this("基础服务失败！",ResponseCode.BASE_ERROR);
    }

    public BriupFrameworkException(String message) {
        this(message,ResponseCode.BASE_ERROR);
    }

    public BriupFrameworkException(String message, Throwable cause) {
        this(ResponseCode.BASE_ERROR,message, cause);
    }

    public BriupFrameworkException(String message, ResponseCode code) {
        this(code,message,null);
    }
    public BriupFrameworkException(ResponseCode code,String message, Throwable cause) {
        super(message,cause);
        this.code = code;
    }
    public BriupFrameworkException(ResponseCode code) {
        super(code.getStatus());
        this.code = code;
    }
}
